<#-- @ftlvariable name="todoList" type="java.util.List<nxu.it.model.Todo>" -->
<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/static/styles/test.css">
    <title>全部待办事项</title>
    <style>.is-complete{
            text-decoration: line-through;
        }</style>
</head>
<body>
<form action="/todo/save" method="post">
    <div class="field">
        <input type="text" id="content" name="content" placeholder="请输入待办事项内容" />
        <input type="submit" value="新建">
    </div>
</form>
<form action="/todo/delete" method="post">
    <div class="field">
        <input type="text" id="content" name="content" placeholder="请输入待办事项内容" />
        <input type="submit" value="删除">
    </div>
</form>
<form action="/todo/update" method="post">
    <div class="field">
        <input type="text" id="content" name="content" placeholder="请输入待办事项内容" />
        <input type="submit" value="更新">
    </div>
</form>
    <table>
        <tr>
            <th>ID</th>
            <th>Content</th>
            <th>Complete</th>
        </tr>
        <#list todoList as todo>
            <tr>
                <td>${todo.id}</td>
                <td <#if (todo.complete)>class="is-complete"</#if>>${todo.content}</td>
                <td><input type="checkbox" ${todo.complete?string('checked','')}></td>
            </tr>
        </#list>
    </table>
</body>
</html>
